<div class="col-sm-12">
  <!-- BOX -->
  <div class="box">
    <div class="box-body">
      <div id="datatable1_wrapper" class="dataTables_wrapper form-inline" role="grid">
      	<div class="row">
          <div class="col-sm-9">
        	  <!--搜索-->
            <div class="col-sm-3 nopadding-left">
              {{callbusi/dict-selector groupCode=constants.foodType
                showName="菜品类型" dictSelect="foodSelect" preselected=false allowClear=true}}
            </div>
            <div class="col-sm-5">
        	    <div class="input-group">
            		{{input class="form-control" type="text" placeholder="搜索 菜品名称" value=queryCondition enter="search"}}
      	        <span class="input-group-btn">
        		      <button class="btn btn-primary btn-reduce" type="button" style="touch-action: manipulation; -ms-touch-action: manipulation;" {{action "search" on="click"}}>
                    <i class="fa fa-search"></i>
                  </button>
      	        </span>
        	    </div>
        	  </div>
        	  <!--搜索-->
          </div>
      	  <div class="user-add-btn col-sm-3 nopadding-right">
            {{#ui/mix-button class="user-btn pull-right" iconClass="fa-plus"  text='新增菜品'  clickAction="addNewFood" addNewFood="addNewFood"}}
            {{/ui/mix-button}}
      	  </div>
      	</div>
        <div class="dataTables_wrapper">
          <table id="datatable1" cellpadding="0" cellspacing="0" border="0" class="datatable table table-bordered table-hover dataTable" aria-descrifoodby="datatable1_info">
            <thead>
              <tr role="row">
                <th rowspan="1" colspan="1" width="">菜品名称</th>
                <th rowspan="1" colspan="1" width="">单价(元/份)</th>
                <th rowspan="1" colspan="1" width="">类型</th>
              </tr>
            </thead>
            <tbody role="alert" aria-live="polite" aria-relevant="all" class="">
              {{#each foodList as |food|}}
              <tr {{action "addNewFood" food on="click"}}>
                <td class="ellipsis" >{{food.name}}</td>
                <td class="ellipsis" >{{food.price}}</td>
                <td class="ellipsis" >{{food.type.typename}}</td>
              </tr>
              {{/each}}
            </tbody>
          </table>
        </div>
        {{#if foodList }}
            {{page-numbers content=foodList showFL=true numPagesToShow=5}}
        {{else}}
                <h1 class="col-sm-12 center unTask"></h1>
        {{/if}}
      </div>
    </div>
  </div>
  <!-- /BOX -->
</div>

{{#bs-form formLayout=formLayout model=foodModel}}
{{#if showpopInvitePassModal}}
    {{#bs-modal body=false footer=false header=false closedAction=(action "invitation")}}
        {{#bs-modal-header}}
            {{#if addDict}}
                <h4 class="modal-title">添加菜品</h4>
            {{else}}
                <h4 class="modal-title">菜品详情</h4>
            {{/if}}
        {{/bs-modal-header}}
        {{#bs-modal-body}}
            <div class="modal-body clearfix">
                <div class="form-group">
                    <div class="col-sm-12 nopadding-right" style="text-align: center;">
                      <div class="col-sm-6 nopadding-horizontal pull-left">
                          {{#ui/img-intergration name="headImg" hasUploader=true showBigImg=true imgSrc=foodModel.avatarUrl height=100 width=100 margin-left=0 uploadUrl=uploadUrl uploadSucc="uploadSucc" uploadFail="uploadFailImg" businessType=constants.uploadBusinessType_headimg as |component|}}
                              <div class="pull-left photo-title {{if detailModify '' 'hidden'}}">
                                  <div class="tip photo-title-color">
                                      请上传菜品照片！
                                  </div>
                                  <div class="photo-footer">
                                      <div class="button pull-left photo-footer-color" {{action 'avatarUpload' target=component on="click"}}>
                                          上传图片
                                      </div>
                                  </div>
                              </div>
                          {{/ui/img-intergration}}
                      </div>
                      <div class="col-xs-6 col-sm-6 nopadding-right nopadding-left">
                        <div class="col-xs-12 col-sm-12 nopadding-right nopadding-left">
                            <div class="form-input-group">
                                <span class="input-group-addon">菜品名称：</span>
                                <div>
                                    <div class="inline-block form-input-group">
                                        {{#if showData}}
                                            {{bs-form-element property="name" class="inline-block form-input-group" controlType="name" placeholder="必填项"}}
                                        {{else}}
                                            <div class="font-light input-group-content">{{foodModel.name}}</div>
                                        {{/if}}
                                    </div>
                                </div>
                            </div>
                            <div class="divide-10"></div>
                        </div>

                        <div class="col-xs-12 col-sm-12 nopadding-right nopadding-left">
                            <div class="form-input-group">
                                <span class="input-group-addon">价格(元/份)：</span>
                                <div>
                                    <div class="inline-block form-input-group">
                                        {{#if showData}}
                                            {{bs-form-element property="price" class="inline-block form-input-group" controlType="price" placeholder="必填项"}}
                                        {{else}}
                                            <div class="font-light input-group-content">{{foodModel.price}}</div>
                                        {{/if}}
                                    </div>
                                </div>
                            </div>
                            <div class="divide-10"></div>
                        </div>
                        <div class="col-xs-12 col-sm-12 nopadding-right nopadding-left">
                            <div class="form-input-group">
                                <span class="input-group-addon">菜品类型：</span>
                                <div class="inline-block form-input-group">
                                    {{#if showData}}
                                      {{#bs-form-element class="inline-block form-input-group" controlType="type"  property="type" }}
                                        {{callbusi/dict-selector class="inline-block" curDict=foodModel.type groupCode=constants.foodType dictSelect="foodTypeSelect"
                                          showName='必填项' preselected=false}}
                                      {{/bs-form-element}}
                                    {{else}}
                                        <div class="font-light input-group-content">{{foodModel.type.typename}}</div>
                                    {{/if}}
                                </div>
                            </div>
                            <div class="divide-10"></div>
                        </div>
                      </div>

                    </div>
                </div>
            </div>
        {{/bs-modal-body}}
        {{#bs-modal-footer class="user-add-btn" as |footer|}}
            {{#if addDict}}
                {{#ui/mix-button class="user-btn edit-btn" iconClass="fa fa-check" text='确定' clickAction="saveClick" saveClick="saveClick" }}
                {{/ui/mix-button}}
                {{#ui/mix-button class="user-btn times-btn" iconClass="fa fa-mail-reply" text='取消' clickAction="invitation" invitation="invitation" }}
                {{/ui/mix-button}}
            {{else}}
                {{#if showData}}
                    {{#ui/mix-button class="user-btn edit-btn" iconClass="fa fa-check" text='确定' clickAction="saveClick" saveClick="saveClick" }}
                    {{/ui/mix-button}}
                    {{#ui/mix-button class="user-btn times-btn" iconClass="fa fa-mail-reply" text='取消' clickAction="invitation" invitation="invitation" }}
                    {{/ui/mix-button}}
                {{else}}
                    {{#ui/mix-button class="user-btn edit-btn" iconClass="fa fa-edit" text='编辑' clickAction="editClick" editClick="editClick" }}
                    {{/ui/mix-button}}
                    {{#ui/mix-button class="user-btn trash-btn" iconClass="fa fa-trash-o" text='删除' clickAction="delateClick" delateClick="delateClick" clickActParams=information }}
                    {{/ui/mix-button}}
                {{/if}}
            {{/if}}
        {{/bs-modal-footer}}
    {{/bs-modal}}
{{/if}}
{{/bs-form}}
